Skip to content

Remove allow_time_extrapolation attribute on Field#1999

Merged
fluidnumericsJoe merged 10 commits intov4-devfrom
remove-time-extrapolation-option
May 13, 2025
Merged

Remove allow_time_extrapolation attribute on Field#1999
fluidnumericsJoe merged 10 commits intov4-devfrom
remove-time-extrapolation-option

Conversation

@fluidnumericsJoe
Copy link
Copy Markdown
Contributor

When a xarray or uxarray dataarray does not have a time dimension, one is added to the Field.data dataarray. When a field.data datarray has a time dimension that is length 1, we assume that extrapolation is allowed meaning that we just keep using the same single time-slice for that field.

When a xarray or uxarray dataarray does not have a time dimension, one
is added to the Field.data dataarray. When a field.data datarray has a
time dimension that is length 1, we assume that extrapolation is
allowed meaning that we just keep using the same single time-slice for
that field.
Comment thread parcels/field.py Outdated
Comment thread parcels/particleset.py Outdated
Comment thread parcels/_index_search.py Outdated
Comment thread parcels/particleset.py Outdated
Comment thread parcels/particleset.py Outdated
@github-project-automation github-project-automation bot moved this from Backlog to Ready in Parcels development May 6, 2025
@VeckoTheGecko
Copy link
Copy Markdown
Contributor

I think it would be easier to rely on the time_interval tooling that was introduced earlier (and is also suggested now in #2000 for Field). This would mean a constant field can be detected by Field.time_interval is None (which I think is nicer than expanding the dims and pontentially triggering computation)/

Co-authored-by: Nick Hodgskin <36369090+VeckoTheGecko@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

@VeckoTheGecko VeckoTheGecko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Minor feedback

Comment thread parcels/field.py Outdated
fluidnumericsJoe and others added 2 commits May 7, 2025 11:54
Co-authored-by: Nick Hodgskin <36369090+VeckoTheGecko@users.noreply.github.com>
@fluidnumericsJoe fluidnumericsJoe merged commit 4035447 into v4-dev May 13, 2025
2 of 8 checks passed
@fluidnumericsJoe fluidnumericsJoe deleted the remove-time-extrapolation-option branch May 13, 2025 13:27
@github-project-automation github-project-automation bot moved this from Ready to Done in Parcels development May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants